package com.bzframework.pro.example.service;

import com.bzframework.pro.example.entity.TreeEntity;
import org.hswebframework.web.crud.service.GenericReactiveTreeSupportCrudService;
import org.hswebframework.web.id.IDGenerator;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author bingzhong
 * @Date 2024/11/20 15:46
 * @Description
 */
@Service
public class TreeService extends GenericReactiveTreeSupportCrudService<TreeEntity, String> {

    @Override
    public IDGenerator<String> getIDGenerator() {
        return IDGenerator.SNOW_FLAKE_STRING;
    }

    @Override
    public void setChildren(TreeEntity entity, List<TreeEntity> children) {
        entity.setChildren(children);
    }
}
